package com.design.singleton;

/**
 * @Author: ChengLei.Liu
 * @Date: 2020-06-05 13:26
 * @Description: 单例模式(懒汉式)
 * 在需要使用到的时候创建对象(懒加载) 节省了资源  但是线程不安全
 */
public class Singleton03 {

    private static Singleton03 instance;

    private Singleton03(){

    }

    public static Singleton03 getInstance(){
        if(instance == null){
            instance = new Singleton03();
        }
        return instance;
    }
}
